package com.oamicnet.servicetwo.server.controller;

import com.oamicnet.servicetwo.server.mq.OrderMessage;
import com.oamicnet.servicetwo.server.mq.OrderMessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class OrderMessageController {

    @Autowired
    private OrderMessageProducer orderMessageProducer;

    @PostMapping("/send")
    public void sendOrderMessage(@RequestBody OrderMessage message) {
        orderMessageProducer.sendOrderMessage(message);
    }
}
